<?php
include_once "topo.php";

if(logado()){
    header("location: index.php");
}

if($_POST["btn_logar"] == "Entrar"){
    if(logar()){
        header("location: login.php");
    }else{
        echo "
        <script>
            alert('Falha no login');
        </script>
        ";
    }
}

?>
            <div id="login">
                <form action="" method="post">
                    <h2>Autenticação</h2>
                    <label>Login</label>
                    <input type="text" name="usuario_ci" id="usuario"><br>
                    <label>Senha</label>
                    <input type="password" name="senha_ci" autocmplete="off"><br>
                    <button type="submit" name="btn_logar" value="Entrar">Entrar</button>
                </form>
                <a href="esq_senha.php" title="Esqueci a senha" id="esq_senha">Esqueci a senha</a>
            </div>
<?php
include_once "rodape.php";
?>
